package com.qdsg.ysg.doctor.ui;

import android.widget.ImageView;
import android.widget.TextView;

import com.rest.response.DoctorResponse;

import butterknife.BindView;
import butterknife.OnClick;
import com.qdsg.ysg.doctor.R;
import com.qdsg.ysg.doctor.base.BaseActivity;

/**
 * Created by Administrator on 2020/2/10.
 */

public class PayActivity extends BaseActivity {
    @BindView(R.id.tv_name)
    TextView tv_name;
    @BindView(R.id.tv_info)
    TextView tv_info;
    @BindView(R.id.tv_price)
    TextView tv_price;
    DoctorResponse.Doctor doctor;
    @BindView(R.id.checkbox)
    ImageView checkbox;

    private boolean isCheckBox;


    @Override
    protected void initViews() {
        tv_name.setText(doctor.docName);
        tv_price.setText(doctor.fee);
        tv_info.setText(doctor.deptName+"  "+doctor.jobTitleName);
    }

    @Override
    protected void initData() {
        doctor = (DoctorResponse.Doctor) getIntent().getSerializableExtra("obj");
    }

    @Override
    protected int getLayoutResource() {
        return R.layout.aty_pay;
    }

    @OnClick(R.id.btn_confirm)
    void btn_confirm() {
        startActivity( PayResultActivity.class);
        finish();
    }

    @OnClick(R.id.checkbox)
    void check_container() {
        if (isCheckBox) {
            checkbox.setImageResource(R.mipmap.check);
        } else {
            checkbox.setImageResource(R.mipmap.check_focus);
        }
        isCheckBox = !isCheckBox;
    }
}
